<template>
  <div class="bigBOX">
    <div class="videoContent" v-if="this.$router.currentRoute.path == '/'">
      <div class="topLogo">
        <img src="../assets/ctbu.png" alt="" />
      </div>
      <video class="videoElement" autoplay loop muted>
        <source src="../assets/ctbuVideo.mp4" type="video/mp4" />
      </video>
      <i></i>
      <p data-aos="fade-down">热烈庆祝重庆工商大学70周年</p>
    </div>
    <div class="layout">
      <Layout>
        <Menu mode="horizontal" class="header" :active-name= activeName @on-select="changeName">
          <div class="layout-logo">
            <img src="../assets/ctbu2.png" alt="" />
          </div>
          <div class="layout-nav">
            <MenuItem name=""> 首页</MenuItem>
            <MenuItem name="schoolDate"> 校庆日程 </MenuItem>
            <MenuItem name="schoolHappy"> 祝福工商 </MenuItem>
            <MenuItem name="schoolPicture"> 影像工商 </MenuItem>
            <MenuItem name="History"> 流金岁月 </MenuItem>
          </div>
        </Menu>
        <Content>
          <div class="indexContent" v-if="this.$router.currentRoute.path == '/'">
            <div class="contentOne">
              <div class="oneTop" data-aos="fade-up" style="padding-top: 6rem">
                <h3>
                  <span>重庆工商大学简介</span>
                  <b></b>
                </h3>
                <p>厚德博学，求实创新</p>
              </div>
              <Row style="margin: 5rem 20rem 0rem" data-aos="fade-up">
                <Col span="24">
                  <Card style="border-radius: 2rem">
                    <div style="min-height: 50rem">111</div>
                  </Card>
                </Col>
              </Row>
            </div>
            <div class="contentTwo">
              <div class="oneTop" data-aos="fade-up" style="padding-top: 6rem">
                <h3>
                  <span>影像工商</span>
                  <b></b>
                </h3>
                <p>发现美，记录美</p>
              </div>
              <Card
                style="
                  margin: 5rem 20rem 0rem 20rem;
                  border-radius: 2rem 2rem 0 0;
                "
                data-aos="zoom-in-up"
              >
                <Row>
                  <Col span="16" data-aos="slide-right">
                    <h2>美丽校园</h2>
                    <p>一起守护</p>
                  </Col>
                  <Col span="8" data-aos="slide-left">
                    <p class="picture">
                      <img src="../assets/picture_1.jpg" alt="" />
                    </p>
                  </Col>
                </Row>
              </Card>
              <Card style="margin: 0rem 20rem">
                <Row data-aos="fade-up">
                  <Col span="8">
                    <p class="picture">
                      <img src="../assets/picture_2.jpg" alt="" />
                    </p>
                  </Col>
                  <Col span="16" style="text-align: right">
                    <h2>美丽校园</h2>
                    <p>一起守护</p>
                  </Col>
                </Row>
              </Card>
              <Card style="margin: 0rem 20rem">
                <Row data-aos="fade-up">
                  <Col span="16">
                    <h2>美丽校园</h2>
                    <p>一起守护</p>
                  </Col>
                  <Col span="8">
                    <p class="picture">
                      <img src="../assets/picture_3.jpg" alt="" />
                    </p>
                  </Col>
                </Row>
              </Card>
              <Card style="margin: 0rem 20rem; border-radius: 0 0 2rem 2rem">
                <Row data-aos="fade-up">
                  <Col span="8">
                    <p class="picture">
                      <img src="../assets/picture_4.jpg" alt="" />
                    </p>
                  </Col>
                  <Col span="16" style="text-align: right">
                    <h2>美丽校园</h2>
                    <p>一起守护</p>
                  </Col>
                </Row>
              </Card>
            </div>
            <div class="contentThree">
              <div class="oneTop" data-aos="fade-up" style="padding-top: 6rem">
                <h3>
                  <span>流金岁月</span>
                  <b></b>
                </h3>
                <p>工商大事记</p>
              </div>
              <Row style="margin: 5rem 20rem 0rem" data-aos="fade-up">
                <Col span="24">
                  <Timeline pending>
                    <TimelineItem>
                      <Icon type="logo-snapchat" slot="dot"></Icon>
                      <p class="time">1976年</p>
                      <Col span="16">
                        <Card>
                          <p class="content">重庆工商大学问世</p>
                          <img src="../assets/picture_1.jpg" alt="" />
                        </Card>
                      </Col>
                    </TimelineItem>
                    <TimelineItem>
                      <p class="time">1984年</p>
                      <Col span="16">
                        <Card>
                          <p class="content">重庆工商大学问世</p>
                          <img src="../assets/picture_1.jpg" alt="" />
                        </Card>
                      </Col>
                    </TimelineItem>
                    <TimelineItem>
                      <p class="time">2007年</p>
                      <Col span="16">
                        <Card>
                          <p class="content">重庆工商大学问世</p>
                          <img src="../assets/picture_1.jpg" alt="" />
                        </Card>
                      </Col>
                    </TimelineItem>
                    <TimelineItem>
                      <p class="time">2010年</p>
                      <Col span="16">
                        <Card>
                          <p class="content">重庆工商大学问世</p>
                          <img src="../assets/picture_1.jpg" alt="" />
                        </Card>
                      </Col>
                    </TimelineItem>
                    <TimelineItem>
                      <p class="time">2011年10月5日</p>
                      <Col span="16">
                        <Card>
                          <p class="content">重庆工商大学问世</p>
                          <img src="../assets/picture_1.jpg" alt="" />
                        </Card>
                      </Col>
                    </TimelineItem>
                    <TimelineItem>
                      <router-link to="/History">查看更多</router-link>
                    </TimelineItem>
                  </Timeline>
                </Col>
              </Row>
            </div>
            <div class="contentFour">
              <div class="oneTop" data-aos="fade-up" style="padding-top: 6rem">
                <h3>
                  <span>祝福工商</span>
                  <b></b>
                </h3>
                <p>为工商70年华诞送祝福</p>
              </div>
              <Row style="margin: 5rem 20rem 0rem" data-aos="fade-up">
                <Col span="24">
                  <Card style="border-radius: 2rem">
                    <div style="min-height: 50rem">444</div>
                  </Card>
                </Col>
              </Row>
            </div>
          </div>
          <router-view></router-view>
        </Content>
        <Footer class="layout-footer-center">2022-2032 &copy; WebDesign</Footer>
      </Layout>
    </div>
  </div>
</template>

<script>

export default {
  data() {
    return {
      activeName:''    //菜单激活名字
    }
  },
  methods: {
    changeName(name){
      this.activeName = name;
      this.$router.push('/'+name);
    }
  },
  mounted() {
    //首先，在mounted钩子window添加一个滚动滚动监听事件
    // window.addEventListener("scroll", this.handleScroll);
  },
  //由于是在整个window中添加的事件，所以要在页面离开时摧毁掉，否则会报错
  beforeDestroy() {
    // window.removeEventListener("scroll", this.handleScroll);
  }
}
</script>

<style scoped>
.topLogo {
  position: absolute;
  top: 1.5rem;
  left: 2rem;
  z-index: 1000;
}
.topLogo img {
  width: 20rem;
  height: 4rem;
}
/* 视频全屏 */
.videoElement {
  object-fit: fill;
  width: 100%;
  height: 100%;
}
.videoContent {
  position: relative;
}
.videoContent i {
  display: block;
  width: 100%;
  height: 99%;
  background: url("../assets/touming.png");
  position: absolute;
  left: 0;
  top: 0;
  z-index: 100;
  background-color: rgba(0, 0, 0, 0.3);
}
.videoContent p {
  position: absolute;
  color: white;
  font-weight: bold;
  font-size: 4.5rem;
  top: 50%;
  left: 50%;
  -ms-transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%) !important;
  margin: 0;
  padding: 0;
  z-index: 100;
}
.layout {
  background: #f5f7f9;
  overflow: visible;
}
.header {
  background-color: rgba(255, 255, 255, 1);
  height: 7rem;
  position: sticky;
  top: 0px;
  z-index: 1000;
}
.layout-nav {
  width: 40rem;
  margin: 0.5rem auto;
  margin-right: 2rem;
}
.layout-logo img {
  width: 21rem;
  height: 5rem;
  float: left;
  position: relative;
  top: 0.8rem;
  left: 2rem;
}
/*主要内容*/
.contentOne {
  background-size: cover !important;
  background: url("../assets/底纹.png") center no-repeat;
  width: 100%;
  padding-bottom: 5rem;
}
.oneTop {
  text-align: center;
}
h3 {
  display: inline-block;
  position: relative;
}
.oneTop h3 span {
  display: block;
  font-size: 4rem;
  line-height: 4rem;
  font-weight: 500;
  color: #ef3a41;
  position: relative;
  background: linear-gradient(
    #ef3a41 10%,
    #ef3a41 50%,
    #d4272d 51%,
    #d4272d 90%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.oneTop h3 b {
  background: url("../assets/底纹.png") center center;
  display: block;
  width: 100%;
  height: 1.5rem;
  margin-top: -1.5rem;
}
.oneTop p {
  font-size: 2rem;
  color: #666;
  line-height: 2rem;
  letter-spacing: 4px;
  padding-top: 1rem;
}
/*第二个*/
.contentTwo {
  background-size: cover !important;
  background: url("../assets/底纹.png") center no-repeat;
  width: 100%;
  padding-bottom: 5rem;
}
.picture {
  overflow: hidden;
  height: 100%;
  width: 100%;
}
.picture img {
  width: 100%;
  height: 100%;
}
/*第三个*/
.contentThree {
  background-size: cover !important;
  background: url("../assets/底纹.png") center no-repeat;
  width: 100%;
  padding-bottom: 5rem;
} /*第四个*/
.contentFour {
  background-size: cover !important;
  background: url("../assets/底纹.png") center no-repeat;
  width: 100%;
  padding-bottom: 5rem;
}
.layout-footer-center {
  text-align: center;
}
</style>
